//
//  MyTripTableViewController.m
//  We_Travel
//
//  Created by lanou3g on 15/12/10.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "MyTripTableViewController.h"
#import "RESideMenu.h"
#import "NH_feedbackModel.h"
#import "MyTripTableViewCell.h"
#import "FirstViewController.h"
@interface MyTripTableViewController ()

@property (nonatomic,strong) NSMutableArray *data;
@property (nonatomic,strong) UIImageView *imageView;


@end

@implementation MyTripTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"leftButtonImage.png"] style:UIBarButtonItemStylePlain target:self action:@selector(presentLeftMenuViewController:)];
    [self.tableView registerNib:[UINib nibWithNibName:@"MyTripTableViewCell" bundle:nil] forCellReuseIdentifier:@"cell_id"];
    self.navigationItem.title = @"欢迎联系我们";
    [self makeData];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)makeData {
    NH_feedbackModel *m1 = [NH_feedbackModel NH_feedbackModelWithtitleLabel:@"常见问题 (FAQ)" andCenterLabel:@"有什么担心和疑问,先来这里看看"];
    NH_feedbackModel *m2 = [NH_feedbackModel NH_feedbackModelWithtitleLabel:@"一对一免费咨询" andCenterLabel:@"留下您的联系方式,我们的旅行专家会结合您制定的计划,为您提供免费咨询"];
    NH_feedbackModel *m3 = [NH_feedbackModel NH_feedbackModelWithtitleLabel:@"拨打服务热线" andCenterLabel:@"110 (工作时间: 0 :00 - 0:00)"];
    NH_feedbackModel *m4 = [NH_feedbackModel NH_feedbackModelWithtitleLabel:@"微信联系我们" andCenterLabel:@"微信服务号:NMB"];
    NH_feedbackModel *m5 = [NH_feedbackModel NH_feedbackModelWithtitleLabel:@"反馈" andCenterLabel:@"欢迎各类反馈,必回"];
    self.data = @[m1,m2,m3,m4,m5].mutableCopy;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return self.data.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MyTripTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_id"];
    if (!cell) {
        cell = [[MyTripTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell_id"];
    }
    NH_feedbackModel *model = self.data[indexPath.row];
    cell.titleLabel.text = model.titleLabel;

    cell.centerLabel.text = model.centerLabel;
    // Configure the cell...
    
    return cell;
}



- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 70;
}


/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be .
    return YES;
}
*/


#pragma mark - Table view delegate

// In a xib-based application, navigation from a table can be handled in -tableView:didSelectRowAtIndexPath:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic may go here, for example:
    // Create the next view controller.

        
        
        
        //        [self.navigationController pushViewController:detailViewController animated:YES];
    
    // Pass the selected object to the new view controller.
    
    // Push the view controller.
    
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
